package com.gxa.community.core.utils;

import java.util.ArrayList;
import java.util.UUID;

/**
 * 作者： Juran on 2022-07-25 12:10
 * 作者博客：iit.la
 */
public class NoUtils {
    //TODO
    //生成邀请码
    public static String GenerateInviteCode(String UserNo) {
        char[] chars = UUID.randomUUID().toString().split("-")[0].toCharArray();
        char[] chars1 = UserNo.toCharArray();
        ArrayList<Character> objects = new ArrayList<>();

        for (int i = 0; i < chars1.length; i++) {
            for (int i1 = 0; i1 < i; i1++) {
                objects.add(chars[(int) (Math.random() * chars.length)]);
                objects.add(chars1[(int) (Math.random() * chars1.length)]);
            }
        }
        String no = "";
        for (Character object : objects) {
            no += object;
        }
        return no;
    }

}
